﻿#region "Header"

//************************************************************************************************************************
//* Name: Site wide appsettings file
//* Description: Singleton class responsible to serve application settings details required while deployment
//*              In the constructor, appsettings.xml file will be read, each tag in the appsettings.xml file will have a corresponding
//*              property setter & getter here.  Through reflection the value in each tag is read and assigned to the property setter.
//*              Also Cache dependency is set to the XML file itself so that whenever appsettings.xml file is updated the cache gets invalidated
//*              and the singleton instance also gets recreated to refelect the changes in the appsettings.
//* Created On: 02-Aug-2011
//* Created By: Swathi
//* Last Modified On: 
//* Last Modified By: 
//* Last Modified Reason: 
//************************************************************************************************************************

#endregion

using System;

namespace Base.Utils
{
    /// <summary>
    /// Represents the configured settings for the Toshiba Seiban App System.
    /// <example>
    /// AppSettings.Instance.db_connection_string;
    /// </example>
    /// </summary> 
    public class AppSettings : BaseSettings<AppSettings> 
    {
        #region "Fields"

        private string _appServerIp = string.Empty;
        private string _appServerName = string.Empty;
        private string _smtpPassword = string.Empty;
        private string _smtpServerIp = string.Empty;
        private string _smtpServerName = string.Empty;
        private string _smtpUsername = string.Empty;
        private string _smtpfromemail = string.Empty;

        private string _loggerName = string.Empty;
        private string _assemblyData = string.Empty;
        private string _environment = string.Empty;
        private string _dmsenvironment = string.Empty;


        public string assembly_data
        {
            get { return _assemblyData; }

            set
            {
                _assemblyData = String.IsNullOrEmpty(value) ? String.Empty : value;
            }
        }

        public string logger_name
        {
            get { return _loggerName; }

            set
            {
                _loggerName = String.IsNullOrEmpty(value) ? String.Empty : value;
            }
        }

        //logger_name

        /// <summary>
        /// dev/tst/prd
        /// </summary>
        public string environment {get;set;}
       

        #endregion

        #region "Properties"

        #region "Server Properties"

        /// <summary>
        /// Gets or sets the appserver IP Address
        /// </summary>
        public string server_ip
        {
            get { return _appServerIp; }

            set
            {
                _appServerIp = String.IsNullOrEmpty(value) ? String.Empty : value;
            }
        }

        

        /// <summary>
        /// Gets or sets the appserver Host Name
        /// </summary>
        public string server_name
        {
            get { return _appServerName; }

            set
            {
                _appServerName = String.IsNullOrEmpty(value) ? String.Empty : value;
            }
        }

        #endregion

        #region "Smtp"

        /// <summary>
        /// Gets or sets the SMTP Server password
        /// </summary>
        public string smtp_password
        {
            get { return _smtpPassword; }
            set
            {
                _smtpPassword = String.IsNullOrEmpty(value) ? String.Empty : value;
            }
        }
        /// <summary>
        /// Gets or sets the SMTP email 
        /// </summary>
        public string smtp_from_email
        {
            get { return _smtpfromemail; }
            set
            {
                _smtpfromemail = String.IsNullOrEmpty(value) ? String.Empty : value;
            }
        }

        /// <summary>
        /// Gets or sets the SMTP Server Port Number
        /// </summary>
        public int smtp_port { get; set; }

        /// <summary>
        /// Gets or sets the SMTP Server IP Address
        /// </summary>
        public string smtp_server_ip
        {
            get { return _smtpServerName; }

            set
            {
                _smtpServerIp = String.IsNullOrEmpty(value) ? String.Empty : value;
            }
        }

        /// <summary>
        /// Gets or sets the SMTP Server name
        /// </summary>
        public string smtp_server_name
        {
            get { return _smtpServerName; }

            set
            {
                _smtpServerName = String.IsNullOrEmpty(value) ? String.Empty : value;
            }
        }

        /// <summary>
        /// Gets or sets the SMTP Server User Name
        /// </summary>
        public string smtp_user_name
        {
            get { return _smtpUsername; }
            set
            {
                _smtpUsername = String.IsNullOrEmpty(value) ? String.Empty : value;
            }
        }

        #endregion

        #region "DMS Properties"
        /// <summary>
        /// Gets or sets the dms environment
        /// </summary>
        public string dms_environment
        {
            get { return _dmsenvironment; }
            set
            {
                _dmsenvironment = String.IsNullOrEmpty(value) ? String.Empty : value;
            }
        }
        #endregion

        #endregion

    }
}